package com.example.demo3.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.demo3.annotation.Crypt;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("t_user")
@Crypt
public class User extends Model<User> {

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String username;

    @Crypt(algorithm = Crypt.Algorithm.SM4)
    private String password;

    private String phone;

    private LocalDate birthday;

    private LocalDateTime createTime;

    @Override
    public Serializable pkVal() {
        return id;
    }
}
